<script>
$(function(){
    $('#post').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state <= 0)
			{
				return false;
			}
			window.location.href = '?app=<?=APP?>&mod=<?=MOD?>&act=list';
		},'json');
        return false;
    });
	$('#parent_id').val(<?=$this->class['parent_id']?>);
});
</script>
<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><h1>客户分类</h1></td>
		<td class="actions">
			<table summary="" cellpadding="0" cellspacing="0" border="0" align="right">
				<tr>
                	<td <?=$this->view_act ?>><a href="?app=customer_category&mod=category">分类列表</a></td>
                    <td <?=$this->import_act ?>><a href="?app=customer_category&mod=import" id="import_table">导入分类</a></td>
					<td <?=$this->add_act ?>><a href="?app=customer_category&mod=category&act=add" id="add_table">添加分类</a></td>
                    <td <?=$this->edit_act ?>><a href="#">编辑分类</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<form id="post" method="post">
<div class="t_2">
     <div class="fl">分类修改</div>
     <div class="fr add_form"><a href="javascript:;" id="add_table"></a></div>
</div>
<div class="order_show" id="info_form">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="info_table">
		<tr>
			<td class="td1">分类名称：</td>
			<td><input name="class_name" value="<?=$this->class['class_name']?>" /></td>
		</tr>
		<tr>
			<td class="td1">上级分类：</td>
			<td>
				<select name="parent_id" id="parent_id">
					<option value="0">顶级分类</option>
					<?php foreach((array)$this->lists as $item): ?>
					<option value="<?=$item['class_id']?>"><?=$item['class_name']?></option>
					<?php endforeach; ?>
				</select>
			</td>
		</tr>
        <tr>
            <td  class="td1">排序：</td>
            <td><input name="sort" value="<?=$this->class['sort']?>" /></td>
        </tr>
		<tr>
			<td class="td1" style="text-align:center" colspan="2"><input type="submit" value="提交" /></td>
		</tr>
     </table>
</div>
</form>